package com.lh.web.service.impl.order;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.lh.common.entity.admin.Reason;
import com.lh.common.entity.admin.ReturnAddress;
import com.lh.common.utils.PageUtils;
import com.lh.web.dao.admin.ReasonMapper;
import com.lh.web.dao.admin.ReturnAddressMapper;
import com.lh.web.service.serviceAdmin.order.ReasonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author FH
 * @ClassName: ReasonServiceImpl
 * @Description: (类作用)
 * @date: 2020-05-20 10:06
 */
@Service
public class ReasonServiceImpl extends ServiceImpl<ReasonMapper, Reason> implements ReasonService {

    @Autowired
    ReturnAddressMapper returnAddressMapper;

    @Override
    public PageUtils queryReasonList(Map<String, Object> param, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Reason> notices = this.baseMapper.queryReasonList(param);
        return new PageUtils(notices);
    }

    @Override
    public int insertReason(Reason reason) {
        return this.baseMapper.insertReason(reason);
    }

    @Override
    public int updateReason(Reason reason) {
        return this.baseMapper.updateReason(reason);
    }

    @Override
    public PageUtils queryReturnAddressList(Map<String, Object> param, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<ReturnAddress> notices = returnAddressMapper.queryReturnAddressList(param);
        return new PageUtils(notices);
    }

    @Override
    public int insertReturnAddress(ReturnAddress returnAddress) {
        return returnAddressMapper.insertReturnAddress(returnAddress);
    }

    @Override
    public int updateReturnAddress(ReturnAddress returnAddress) {
        return returnAddressMapper.updateReturnAddress(returnAddress);
    }

    @Override
    public int updateReasonStatus(Map<String, Object> param) {
        return this.baseMapper.updateReasonStatus(param);
    }

    @Override
    public int updateReturnAddressStatus(Map<String, Object> param) {
        return returnAddressMapper.updateReturnAddressStatus(param);
    }
}
